<?php


namespace App\Http\Controllers\Api;


use App\Models\CommissionedRecruit;
use Dingo\Api\Http\Request;

class CommissionedRecruitController extends BaseController
{

    public function store(Request $request) {
        $this->validate($request, [
            'real_name' => 'required',
            'phone' => 'regex:/^1[3456789][0-9]{9}$/',
            'role_id' => 'required|exists:config,id',
        ]);
        $input = $request->input();
        $info = CommissionedRecruit::create($input);
        $id = $info->id;
        return $this->success($id);
    }

}

